/**
 * 	a script for adding more than 1 session to a course
 */
$(document).ready(function(){
  $("#addSession").click(function(){
	  var newSession= $("#session").clone();
	  var number = newSession.find("p").length;
	  number=number+1;
	  var toAdd = newSession.children().first();
	  toAdd.find("#ses").attr("name","ses"+number);
	  toAdd.find("#start").attr("name","start"+number);
	  toAdd.find("#end").attr("name","end"+number);
	  $("#session").append(toAdd);
  });
  $("#removeSession").click(function(){
	 if ($("#session").find("p").length>1){
		 $("#session p:last-child").remove();
	 }
  });
});